package com.hwd.gmall.list.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 搜索微服务远程调用接口
 *
 * @author 黄伟东/Victor
 * @date 2022/4/27 19:35
 */
@FeignClient(value = "service-list", path = "/list/goods", contextId = "listFeignClient")
public interface ListFeignClient {

    /**
     * 向es中保存数据，商品上架时调用
     *
     * @param skuId 商品id
     * @return boolean
     */
    @GetMapping(value = "/saveDataIntoEs/{skuId}")
    boolean saveDataIntoEs(@PathVariable(value = "skuId") Long skuId);

    /**
     * 在es中删除数据，商品下架时调用
     *
     * @param skuId 商品id
     * @return boolean
     */
    @GetMapping(value = "/removeDataFromEs/{skuId}")
    boolean removeDataFromEs(@PathVariable(value = "skuId") Long skuId);
}
